home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 2 / AACD 2.iso / AACD / Magazine / GraphicsCards / StormMesa / mklib.netbsd < prev    next >
Text File  |  1998-12-15  |  1KB  |  55 lines

  1. #!/bin/sh
  2.  
  3. # Make a NetBSD shared library
  4. # contributed by Michael Graff (explorer@flame.org)
  5. # updated by Jarkko Hietaniemi (jarkko.hietaniemi@research.nokia.com)
  6.  
  7. #--identification------------------------------------------------------
  8.  
  9. # $Id: mklib.netbsd,v 1.8 1997/11/04 02:55:35 brianp Exp $
  10.  
  11. # $Log: mklib.netbsd,v $
  12. # Revision 1.8  1997/11/04 02:55:35  brianp
  13. # applied Erik Johannessen's changes
  14. #
  15. # Revision 1.7  1997/10/21 23:32:31  brianp
  16. # now takes major and minor version arguments
  17. #
  18.  
  19. #--common--------------------------------------------------------------
  20.  
  21. # Usage:  mklib libname major minor file.o ...
  22. #
  23. # First argument is name of output library (LIBRARY)
  24. # Second arg is major version number (MAJOR)
  25. # Third arg is minor version number (MINOR)
  26. # Rest of arguments are object files (OBJECTS)
  27.  
  28. LIBRARY=$1
  29. shift 1
  30.  
  31. MAJOR=$1
  32. shift 1
  33.  
  34. MINOR=$1
  35. shift 1
  36.  
  37. OBJECTS=$*
  38.  
  39. #--platform------------------------------------------------------------
  40.  
  41. set -x
  42.  
  43. LIBRARY=`basename ${LIBRARY} .so`
  44.  
  45. VERSION="${MAJOR}.${MINOR}"
  46.  
  47. echo "Building PIC library $LIBRARY"
  48. rm -f ${LIBRARY}_pic.a ${LIBRARY}.so.${VERSION}
  49. ar cq ${LIBRARY}_pic.a ${OBJECTS}
  50. ranlib ${LIBRARY}_pic.a
  51.  
  52. ld -x -Bshareable -Bforcearchive -o ${LIBRARY}.so.${VERSION} ${LIBRARY}_pic.a
  53.  
  54. cp ${LIBRARY}_pic.a ${LIBRARY}.so.${VERSION} ../lib
  55.